exports.setImageCrop = function(req,res){

    var path = require("path");

    //获取body参数
    var bodyParams = req.routeInfo.bodyParams;

    //获取要处理的文件名称
    var imageUrl = path.basename(bodyParams.srcImageUrl);

    //处理完成后的图片名称
    var newFileName = "c_" + imageUrl;

    GM(bodyParams.srcImageUrl)
    .crop(bodyParams.width,bodyParams.height,bodyParams.x,bodyParams.y).write("./" + config.fileManager.baseDir + "/" + config.uploadImageConfig.imageParocessingDir + "/" + newFileName, function (err) {
        
        if (err){
            return RES.errorResponse(res,"图片裁切失败");
        }

        RES.successResponse(res,config.server.ip + ":" + config.server.port + "/" + config.uploadImageConfig.imageParocessingDir + "/" + newFileName);
              
    })

}